//全局路径
const commonUrl = 'https://zcmlm.top:6060';
//解析json
function parseJSON(response) {
  return response.json()
}


export default function request(options = {}) {
  const { data, url } = options
  options = { ...options }
  options.body = JSON.stringify(data)
  options.headers = {
      'Content-Type': 'application/json'
  }
  return fetch(commonUrl + url, options)
    .then(parseJSON)
}